using System.Collections.Generic;
using System.Linq;

namespace TaskKernel.Infrastructure
{
    public class RecipientList
    {
        private List<string> _recipientList;

        public RecipientList()
        {
            _recipientList = new List<string>();
        }

        public virtual IEnumerable<string> GetList()
        {
            return _recipientList.Distinct();
        }

        public virtual void Add(string recipient)
        {
            _recipientList.Add(recipient);
        }

        public virtual void Remove(string recipient)
        {
            _recipientList = _recipientList.Distinct().ToList();
            _recipientList.Remove(recipient);
        }
    }
}